






<div class="admin-biaogelist">

    <div class="listbiaoti am-cf">
        <ul class="am-icon-flag on"> 任务管理</ul>

        <dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="#">任务管理</a></dl>

        <!--<dl>
          <button type="button" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus" > 补充线订单</button>
        </dl>-->
        <!--这里打开的是新页面-->

    </div>

    <div class="fbneirong">
        <form class="am-form am-g">
            <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped am-table-hover">
                <thead>
                <tr class="am-success">
                    <th class="table-check"><input type="checkbox" /></th>

                    <th class="table-id">ID</th>
                    <th class="table-title">主商品</th>
                    <th class="table-type">单量</th>
                    <th class="table-author am-hide-sm-only">本金</th>
                    <th class="table-author am-hide-sm-only">金币</th>
                    <th class="table-date am-hide-sm-only">关键词</th>
                    <th width="130px" class="table-set">任务状态</th>
                    <th width="130px" class="table-set">操作</th>

                </tr>
                </thead>
                <tbody class="impowdith">





                </tbody>
            </table>

            <!--  <div class="am-btn-group am-btn-group-xs">
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 删除</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 上架</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 下架</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 移动</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 保存</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-archive"></span> 移动</button>
                  <button type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除</button>
              </div>-->



            <div id="Pagination" style="margin:20px auto" style="display:none"></div>

            <!--  <ul class="am-pagination am-fr">


              </ul>-->




            <hr />

        </form>



    </div>



    <script>







        var on_request=false;
        var type=1;
        var page=1;






        function setlisthtnml(data) {
            var html="";


      /*  <a class="am-btn am-btn-default am-btn-xs am-text-success am-round am-icon-file" data-am-modal="{target: '#my-popups'}" title="添加子栏目"></a>*/

            if(data.list.length>0){
                $.each(data.list, function (key, value) {
                     html=html+
                         '<tr  taskid="'+value.id+'" ><td><input type="checkbox" /></td>\n'+
                         '<td>'+value.id+'</td>\n'+
                         '<td>'+value.goods_name+'</td>\n'+
                        '<td>'+value.number+'</td>\n'+
                        '<td>'+value.money+'</td>\n'+
                        '<td>'+value.gold+'</td>\n'+
                        '<td>'+value.keyword+'</td>\n'+
                        '<td>'+value.status+'</td>\n'+
                        '<td>'+
                         ''+
                         '<div class="am-btn-toolbar">\n'+
                         '<div class="am-btn-group am-btn-group-xs">\n'+
                         ' <div class="am-btn am-btn-default am-btn-xs am-text-success am-round"><a class="am-icon-search"   href="<?php echo base_url()."business/viewjdtask/'+value.id+'"; ?>"  title="查看订单详情"></a> </div>\n'+
                         ' <a class="am-btn am-btn-default am-btn-xs am-text-success am-round am-icon-file"  href="<?php echo base_url()."business/order_list/'+value.id+'"; ?>" title="查看"></a>\n'+
                         ' <div class="am-btn am-btn-default am-btn-xs am-text-success am-round"><a class="am-icon-search"   href="<?php echo base_url()."business/relodjdtask/'+value.id+'"; ?>"  title="重新编辑"></a> </div>\n'+
                         '</div>\n'+
                         '</div>'+
                         ''+
                         '</td></tr>';
                });
                $(".impowdith").html(html);
                $('#Pagination').show();

                $(".againtask").click(function () {

                    var id=$(this).parents("tr").attr("taskid");
                    fabu(id);
                });



            }else{
                html += '<li><div style="width:100%;text-align:center;">&nbsp暂无数据</div></li>';
                $(".impowdith").html(html);
                $('#Pagination').hide();
            }



            function fabu(id) {
                if (on_request) {
                    return;
                }
                var r =confirm("确认再次发布该任务?");

                if(!r){
                    return;;
                }

                on_request = true;
                var url = "<?php echo base_url(); ?>/Business/againtask";
                var postdata = {};
                postdata['id'] = id;
                $.post(url, postdata, function (data) {
                    on_request = false;
                    if(data.status==0){
                        alert("任务发布成功")
                    } else{
                        alert(data.message)
                    }


                },"json");
            }





         /*   $(".showtilog").click(function () {

                document.getElementById('body').innderHTML = '<div class="am-dimmer am-active" data-am-dimmer="" style="display: block;"></div>';


                $("#my-popups").show();
            });*/

        }







        gettasklist();
        function gettasklist() {
            var url = "<?php echo base_url(); ?>/Business/GetJdTaskList";
            var postdata = {
                'page': page,
                'epage': 10
            };
            $.post(url, postdata, function (data) {
                on_request = false;
                setlisthtnml(data);
                setPagination("Pagination", data.count, page, data.epage, function (clickPage) {
                    page = parseInt(clickPage) + 1;
                    gettasklist();
                });
            },'json');

        }





    </script>



    <div class="am-popup am-popup-inner" id="my-popups">
        <div class="am-popup-hd">
            <h4 class="am-popup-title">修改栏目名称</h4>
            <span data-am-modal-close class="am-close">&times;</span> </div>
        <div class="am-popup-bd">
            <form class="am-form tjlanmu">
                <div class="am-form-group">
                    <div class="zuo">栏目名称：</div>
                    <div class="you">
                        <input type="email" class="am-input-sm" id="doc-ipt-email-1" placeholder="请输入标题">
                    </div>
                </div>
                <div class="am-form-group">
                    <div class="zuo">栏目关键词：</div>
                    <div class="you">
                        <input type="password" class="am-input-sm" id="doc-ipt-pwd-1" placeholder="请输入关键词">
                    </div>
                </div>
                <div class="am-form-group am-cf">
                    <div class="zuo">栏目描述：</div>
                    <div class="you">
                        <textarea class="" rows="2" id="doc-ta-1"></textarea>
                    </div>
                </div>
                <div class="am-form-group am-cf">
                    <div class="zuo">栏目图片：</div>
                    <div class="you" style="height: 45px;">
                        <input type="file" id="doc-ipt-file-1">
                        <p class="am-form-help">请选择要上传的文件...</p>
                    </div>
                </div>
                <div class="am-form-group am-cf">
                    <div class="zuo">简介：</div>
                    <div class="you">
                        <textarea class="" rows="2" id="doc-ta-1"></textarea>
                    </div>
                </div>
                <div class="am-form-group am-cf">
                    <div class="zuo">状态：</div>
                    <div class="you" style="margin-top: 3px;">
                        <label class="am-checkbox-inline">
                            <input type="checkbox" value="option1">
                            显示 </label>
                        <label class="am-checkbox-inline">
                            <input type="checkbox" value="option2">
                            隐藏 </label>
                    </div>
                </div>
                <div class="am-form-group am-cf">
                    <div class="you">
                        <p>
                            <button type="submit" class="am-btn am-btn-success am-radius">提交</button>
                        </p>
                    </div>
                </div>
            </form>
        </div>
    </div>






    <div class="foods">
        <ul>
            版权所有@2015.
        </ul>
        <dl>
            <a href="" title="返回头部" class="am-icon-btn am-icon-arrow-up"></a>
        </dl>
    </div>




</div>

</div>




</div>


<!--<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>-->
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/polyfill/rem.min.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/polyfill/respond.min.js"></script>
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/amazeui.legacy.js"></script>


<!--[if (gte IE 9)|!(IE)]><!-->
<script src="<?php echo base_url() . 'public/business/'; ?>assets/js/amazeui.min.js"></script>
<!--<![endif]-->



</body>
</html>